﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using TreeBuilder.Contracts;
using MvvmTreeView;

namespace TreeBuilder.ViewModels
{
    public abstract class TreeBuilderTreeNodeImageNode : TreeBuilderTreeNodeBase
    {
        public TreeBuilderTreeNodeImageNode(ITreeBuilderService treeBuilderService, ITreeView treeView, ITreeNode parent) : base(treeBuilderService, treeView, parent)
        {
        }

        public abstract ITreeNodeImage TreeNodeImage { get; set; }

        public override bool HasLayoverImage<T>(out T image)
        {
            if (this.TreeNodeImage != null)
            {
                image = (T)this.TreeNodeImage.GetImage<T>();
                return true;
            }
            else
            {
                image = default(T);
                return false;
            }
        }
    }
}
